<template>
    <div class="file-push-lits-box">
        <div class="file-push-list">
            <div v-for="item in fileList" :key='item.id' class="file-push-item-wrap">
                {{item.filename}}.{{item.suffix}}
                （{{item.size?(0.01 > (item.size/1024/1024/1000) ? 0.01 : (item.size/1024/1024/1000).toFixed(2)):0}} M）
                <a target="_blank" :href="`${prefix}push/file?url=${item.url}`" style='margin-right: 12px;'>下载</a>
                <a v-if='item.suffix === "pdf" || item.suffix === "txt"' target="_blank" :href="item.url">查看</a>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        props: {
            fileList: {
                type: Array,
                default: () => ([])
            }
        },
        data(){
            return {
                prefix: process.env.VUE_APP_BASE_URL
            }
        },
        mounted(){

        }
    }
</script>

<style lang='scss' scoped>
    .file-push-lits-box{
        .file-push-list{
            .file-push-item-wrap{
                padding: 0 20px;
                line-height: 2;
            }
        }
    }
</style>